//
//  DataBaseHandle.h
//  豆瓣HW
//
//  Created by dllo on 15/12/3.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
@class User;

@interface DataBaseHandle : NSObject

+ (instancetype)shareDataBase;
- (void)openDB;
- (void)closeDB;
- (void)createUserTable;
- (void)createActivityTable;
- (void)createMovieTable;

- (void)deleteUserTable;
- (void)deleteActivityDataWithUserName:(User *)user;
- (void)deleteMovieDataWithUserName:(User *)user;

- (void)insertDataWithUser:(User *)user;
- (void)insertDataWithActivity:(User *)user;
- (void)insertDataWithMovie:(User *)user MovieName:(NSString *)title;

- (void)deleteDataWithUserName:(NSString *)name;
- (void)deleteDataWithActivityTitle:(NSString *)title;
- (void)deleteDataWithMovieTitle:(NSString *)title;

- (void)updateDataWithUser:(User *)user;
- (void)updateDataWithActivity:(User *)user ActivityName:(NSString *)title;
- (void)updateDataWithMovie:(User *)user MovieName:(NSString *)title;

- (NSMutableArray *)selectAllUser;
- (User *)selectByName:(NSString *)name;
- (User *)selectByState:(NSString *)state;
- (NSMutableArray *)selectByActivityTitle:(NSString *)title;
- (NSMutableArray *)selectByMovieTitle:(NSString *)title;
- (NSMutableArray *)selectActivityByName:(NSString *)name;
- (NSMutableArray *)selectMovieByName:(NSString *)name;






@end
